<?php
include "{$_SERVER["DOCUMENT_ROOT"]}/modules/footer/data.php";


$link_sections = array("about", "browse", "quicklinks", "courses");

foreach ($link_sections as $key => $ls) {
    if (count($_REQUEST[$ls])>0) {
        foreach ($_REQUEST[$ls] as $ls_key => $ls_data) {
            $links[$ls]["links"][$ls_key]["text"] = $_REQUEST[$ls][$ls_key]["text"];
            $links[$ls]["links"][$ls_key]["url"] = $_REQUEST[$ls][$ls_key]["url"];
        }
    }
   
}

$fp = fopen($links_file, 'w');
fwrite($fp, json_encode($links));
fclose($fp);

?>
Links have been saved
